import request from '@/utils/request'

// 查询婚恋匹配记录列表
export function listMatch(query) {
  return request({
    url: '/dating/match/list',
    method: 'get',
    params: query
  })
}

// 查询婚恋匹配记录详细
export function getMatch(matchId) {
  return request({
    url: '/dating/match/' + matchId,
    method: 'get'
  })
}

// 新增婚恋匹配记录
export function addMatch(data) {
  return request({
    url: '/dating/match',
    method: 'post',
    data: data
  })
}

// 修改婚恋匹配记录
export function updateMatch(data) {
  return request({
    url: '/dating/match',
    method: 'put',
    data: data
  })
}

// 删除婚恋匹配记录
export function delMatch(matchIds) {
  return request({
    url: '/dating/match/' + matchIds,
    method: 'delete'
  })
}

// 自动匹配算法
export function autoMatch(memberId, maxCount = 5) {
  return request({
    url: '/dating/match/auto/' + memberId,
    method: 'post',
    params: {
      maxCount: maxCount
    }
  })
}

// 手动创建匹配
export function manualMatch(memberIdA, memberIdB, remark) {
  return request({
    url: '/dating/match/manual',
    method: 'post',
    params: {
      memberIdA: memberIdA,
      memberIdB: memberIdB,
      remark: remark
    }
  })
}

// 查询指定人员的匹配记录
export function getMatchByMember(memberId) {
  return request({
    url: '/dating/match/member/' + memberId,
    method: 'get'
  })
}

// 获取匹配统计数据
export function getMatchStatistics() {
  return request({
    url: '/dating/match/statistics',
    method: 'get'
  })
}

// 批量自动匹配
export function batchAutoMatch(memberIds, maxCount = 3) {
  return request({
    url: '/dating/match/batchAuto',
    method: 'post',
    params: {
      memberIds: memberIds,
      maxCount: maxCount
    }
  })
} 